//
//  YDYFenQuCell.m
//  DY_Bilibili
//
//  Created by 杨德勇 on 2016/10/6.
//  Copyright © 2016年 杨德勇. All rights reserved.
//

#import "YDYFenQuCell.h"
#import "YDYFenQu.h"
#import <UIImage+YYAdd.h>
@interface YDYFenQuCell()
@property (weak, nonatomic) IBOutlet UIImageView *profileImgView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;


@end
@implementation YDYFenQuCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
}
-(void)setFenqu:(YDYFenQu *)fenqu{
    _fenqu = fenqu;
    self.titleLabel.text = fenqu.name;
    self.profileImgView.image = [[[UIImage imageNamed:fenqu.icon] imageByResizeToSize:CGSizeMake(60, 60) contentMode:UIViewContentModeScaleToFill] imageByRoundCornerRadius:30.0];
    
    UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.bounds cornerRadius:8.0];
    CAShapeLayer *masklayer = [[CAShapeLayer alloc]init];
    masklayer.frame = self.bounds;
    masklayer.path = path.CGPath;
    self.layer.mask = masklayer;
    
    [self layoutIfNeeded];
}
@end
